package cn.iocoder.yudao.module.mqtt.dal.mysql.devicereport;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.mqtt.dal.dataobject.devicereport.DeviceReportDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mqtt.controller.admin.devicereport.vo.*;

/**
 * MQTT报表分类 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface DeviceReportMapper extends BaseMapperX<DeviceReportDO> {

    default PageResult<DeviceReportDO> selectPage(DeviceReportPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceReportDO>()
                .eqIfPresent(DeviceReportDO::getDeviceId, reqVO.getDeviceId())
                .likeIfPresent(DeviceReportDO::getReportName, reqVO.getReportName())
                .eqIfPresent(DeviceReportDO::getDataType, reqVO.getDataType())
                .eqIfPresent(DeviceReportDO::getMqttNum, reqVO.getMqttNum())
                .eqIfPresent(DeviceReportDO::getReportType, reqVO.getReportType())
                .betweenIfPresent(DeviceReportDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceReportDO::getId));
    }

}